package com.example.hehecat.yuejian1.mvp.model;

import com.example.hehecat.yuejian1.http.RetrofitHttp;
import com.example.hehecat.yuejian1.mvp.contract.PictureInfoContract;
import com.example.hehecat.yuejian1.mvp.model.bean.PictureBean;

import okhttp3.OkHttpClient;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

public class PictureInfoModel implements PictureInfoContract.Model{
    @Override
    public void getPicture(int picture_id, Subscriber<PictureBean> subscriber) {
        OkHttpClient.Builder builder = new OkHttpClient.Builder();
        RetrofitHttp.getRetrofit(builder).getPictureInfo(picture_id)
                .subscribeOn(Schedulers.newThread())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(subscriber);
    }
}
